Hi Kevin, What are you returning in your callback function? Any non-zero value should cause the interpreter to abort (and call InterpreterComplete). If you want the Interpreter to continue you must return zero. Regards TK
Group: DynoMotion |
Message: 6374 |
From: fireup_kev |
Date: 1/1/2013 |
Subject: Re: "SetMcodeAction" don't work for M100 to M119 |
The Callback function for InterpreterUserMCodeCallbackRequested returns a void so I can't return anything. It works fine for M3 to M9 but not M100 to M119.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Kevin,
>
> What are you returning in your callback function? Any non-zero value should cause the interpreter to abort (and call InterpreterComplete).
>
> If you want the Interpreter to continue you must return zero.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: fireup_kev <kliboon@...>
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, January 1, 2013 1:34 PM
> Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 to M119
>
>
> Â
> It works for me also if I use M_Action_Setbit, but if I use M_Action_Callback, it will call the callback and then call InterpreterComplete and end the program even though it's not the end of the program.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Kevin,
> >
> > It seems to work fine for me using the Dynomotion VB.NET Example in V4.30j:
> >
> > I configured M100 and M101 actions to toggle Bit 46 (KFLOP LED0) on and off with:
> >
> > ÃÂ ÃÂ ÃÂ Public Sub Run()
> >
> > ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ _Controller.CoordMotion.Interpreter.SetMcodeAction(21, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 1, 0, 0, 0, "")
> > ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ _Controller.CoordMotion.Interpreter.SetMcodeAction(22, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 0, 0, 0, 0, "")
> >
> > ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ _InterpreterStatus = ""
> > ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ If System.IO.File.Exists(_InterpreterFileName) = True Then
> > ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ _Controller.CoordMotion.Interpreter.Interpret(_InterpreterFileName)
> > ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ End If
> >
> >
> >
> > Then ran GCode of:
> >
> > G0 X0 Y0 Z0
> > F40
> > M100
> > G1 X0 Y1
> > M101
> > G1 X0 Y0
> > M100
> > G1 X1 Y0
> > M101
> > G1 X0 Y0
> > M2
> >
> >
> > And the KFLOP LED toggles on and off
> >
> > Regards
> > TK
> >
> >
> >
> >
> >
> > ________________________________
> > From: fireup_kev <kliboon@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Sunday, December 30, 2012 12:10 PM
> > Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 = M119
> >
> >
> > ÃÂ
> > I tried using SetMcodeAction(21, ... for M100 with no effect.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Kevin,
> > >
> > > I'm not sure how you are using it but the "MCode Action" number is not the same as the MCode number.ÃâàAll the MCodes 0-10, the 10 user button actions, and the 20 M100-119 actions are all packed into an array ofÃâà41 actions.
> > >
> > > M100 is the 21st Action not the 100th.ÃâàHere is the related constants from GCodeInterpreter.h.ÃâàWe should export them to C#
> > >
> > > #define MAX_MCODE_ACTIONS_M1 11ÃâàÃâàÃâàÃâàÃâàÃâàÃâà// actually only 2-10 are used
> > > #define MAX_MCODE_ACTIONS_BUTTONS 10
> > > #define MAX_MCODE_ACTIONS_M100 20
> > > #define MAX_MCODE_ACTIONS (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_M100+MAX_MCODE_ACTIONS_BUTTONS)
> > > #define MAX_MCODE_DOUBLE_PARAMS 5
> > > #define MCODE_ACTIONS_M100_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS)
> > >
> > >
> > > HTH
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: fireup_kev <kliboon@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Saturday, December 29, 2012 11:50 PM
> > > Subject: [DynoMotion] "SetMcodeAction" don't work for M100 = M119
> > >
> > >
> > > ÃâÃÂ
> > > "CoordMotion.Interpreter.SetMcodeAction" for .NET don't seem to work for M100 to M119 (unless I'm using it wrong)
> > >
> > > Thanks,
> > > Kevin
> > >
> >
>
|
|
Group: DynoMotion |
Message: 6377 |
From: Tom Kerekes |
Date: 1/1/2013 |
Subject: Re: "SetMcodeAction" don't work for M100 to M119 |
Hi Kevin,
You are correct. That is a bug. Please try substituting the attached two files and returning a 0.
I guess it was just luck that the
undefined return value for the lower M Codes was zero for some reason.
Regards TK
Group: DynoMotion |
Message: 6378 |
From: fireup_kev |
Date: 1/1/2013 |
Subject: Re: "SetMcodeAction" don't work for M100 to M119 |
That seems to fixed it, Thanks.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Kevin,
>
> You are correct. That is a bug. Please try substituting the attached two files and returning a 0.
>
> I guess it was just luck that the undefined return value for the lower M Codes was zero for some reason.
>
> Regards
> TK
>
>
>
> ________________________________
> From: fireup_kev <kliboon@...>
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, January 1, 2013 7:16 PM
> Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 to M119
>
>
> Â
> The Callback function for InterpreterUserMCodeCallbackRequested returns a void so I can't return anything. It works fine for M3 to M9 but not M100 to M119.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Kevin,
> >
> > What are you returning in your callback function?ÃÂ Any non-zero value should cause the interpreter to abort (and call InterpreterComplete).
> >
> > If you want the Interpreter to continue you must return zero.
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ________________________________
> > From: fireup_kev <kliboon@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Tuesday, January 1, 2013 1:34 PM
> > Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 to M119
> >
> >
> > ÃÂ
> > It works for me also if I use M_Action_Setbit, but if I use M_Action_Callback, it will call the callback and then call InterpreterComplete and end the program even though it's not the end of the program.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Kevin,
> > >
> > > It seems to work fine for me using the Dynomotion VB.NET Example in V4.30j:
> > >
> > > I configured M100 and M101 actions to toggle Bit 46 (KFLOP LED0) on and off with:
> > >
> > > ÃâàÃâàÃâàPublic Sub Run()
> > >
> > > ÃâàÃâàÃâàÃâàÃâàÃâàÃâà_Controller.CoordMotion.Interpreter.SetMcodeAction(21, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 1, 0, 0, 0, "")
> > > ÃâàÃâàÃâàÃâàÃâàÃâàÃâà_Controller.CoordMotion.Interpreter.SetMcodeAction(22, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 0, 0, 0, 0, "")
> > >
> > > ÃâàÃâàÃâàÃâàÃâàÃâàÃâà_InterpreterStatus = ""
> > > ÃâàÃâàÃâàÃâàÃâàÃâàÃâàIf System.IO.File.Exists(_InterpreterFileName) = True Then
> > > ÃâàÃâàÃâàÃâàÃâàÃâàÃâàÃâàÃâàÃâàÃâà_Controller.CoordMotion.Interpreter.Interpret(_InterpreterFileName)
> > > ÃâàÃâàÃâàÃâàÃâàÃâàÃâàEnd If
> > >
> > >
> > >
> > > Then ran GCode of:
> > >
> > > G0 X0 Y0 Z0
> > > F40
> > > M100
> > > G1 X0 Y1
> > > M101
> > > G1 X0 Y0
> > > M100
> > > G1 X1 Y0
> > > M101
> > > G1 X0 Y0
> > > M2
> > >
> > >
> > > And the KFLOP LED toggles on and off
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: fireup_kev <kliboon@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Sunday, December 30, 2012 12:10 PM
> > > Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 = M119
> > >
> > >
> > > ÃâÃÂ
> > > I tried using SetMcodeAction(21, ... for M100 with no effect.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Kevin,
> > > >
> > > > I'm not sure how you are using it but the "MCode Action" number is not the same as the MCode number.ÃÆ'ââ¬Å¡ÃâàAll the MCodes 0-10, the 10 user button actions, and the 20 M100-119 actions are all packed into an array ofÃÆ'ââ¬Å¡Ãâà41 actions.
> > > >
> > > > M100 is the 21st Action not the 100th.ÃÆ'ââ¬Å¡ÃâàHere is the related constants from GCodeInterpreter.h.ÃÆ'ââ¬Å¡ÃâàWe should export them to C#
> > > >
> > > > #define MAX_MCODE_ACTIONS_M1 11ÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡ÃâàÃÆ'ââ¬Å¡Ãâà// actually only 2-10 are used
> > > > #define MAX_MCODE_ACTIONS_BUTTONS 10
> > > > #define MAX_MCODE_ACTIONS_M100 20
> > > > #define MAX_MCODE_ACTIONS (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_M100+MAX_MCODE_ACTIONS_BUTTONS)
> > > > #define MAX_MCODE_DOUBLE_PARAMS 5
> > > > #define MCODE_ACTIONS_M100_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS)
> > > >
> > > >
> > > > HTH
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: fireup_kev <kliboon@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Saturday, December 29, 2012 11:50 PM
> > > > Subject: [DynoMotion] "SetMcodeAction" don't work for M100 = M119
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > "CoordMotion.Interpreter.SetMcodeAction" for .NET don't seem to work for M100 to M119 (unless I'm using it wrong)
> > > >
> > > > Thanks,
> > > > Kevin
> > > >
> > >
> >
>
|
|
| | | |